import { configureStore } from "@reduxjs/toolkit"
import productsReducer from "./slices/productsSlice"
import categoriesReducer from "./slices/categoriesSlice"
import cartReducer from "./slices/cartSlice"
// 配置 store
// 包括 reducer
// 中间件 middleware
// devTools 开发者工具
// enhancers 增强器
export const store = configureStore({
    // 存放 由 slice 生成的 reducer
    reducer: {
        products: productsReducer,
        categories: categoriesReducer,
        cart: cartReducer,
    },
    // 开启 redux 开发者工具
    devTools: () => true,
})